package com.ants.logic.visualize.controller;

import com.ants.core.utils.Response;
import com.ants.logic.visualize.dto.OrderCreateDto;
import com.ants.logic.visualize.service.TblOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 蚂蚁会花呗
 * @date 2021/9/9 15:21
 */
@RestController
@RequestMapping("order/order")
public class TblOrderController {

    @Autowired
    private TblOrderService tblOrderService;

    /**
     *
     * http://localhost:8201/order/order/create?userId=1&productId=4fbac46efcb49890f3b1c6e6c30e9da1&count=6&money=98.97
     *
     * 创建订单
     * @param createDto
     * @return
     */
    @GetMapping("create")
    public Response create(OrderCreateDto createDto){
        tblOrderService.create(createDto);
        return Response.ok();
    }

}
